﻿using System;
using System.IO;
using System.Reflection;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;


namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                string runconfig = File.ReadAllText(args[0],System.Text.Encoding.Unicode).Replace(@"\", @"\\");
                string inputjson = File.ReadAllText(args[1], System.Text.Encoding.Unicode).Replace(@"\", @"\\");
                string outputjson = File.ReadAllText(args[2], System.Text.Encoding.Unicode).Replace(@"\", @"\\");
                JObject jo = (JObject)JsonConvert.DeserializeObject(runconfig);
                Assembly.LoadFile(jo["dllpath"].ToString()).GetType(jo["classname"].ToString()).GetMethod(jo["methodname"].ToString()).Invoke(null, new object[] { inputjson, outputjson });
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }

    }
}
